<?php

class Benservi_Forms_Auth extends Zend_Form{

    public function init(){

        $email = new Zend_Form_Element_Text('email');
        $email->setLabel('Email: ')
              ->setRequired(true)
              ->addValidator('EmailAddress')              
              ->addErrorMessage("Por favor informe um email / email incorreto")
              ->setOptions(array('class' => 'input-m'));

        $email->setDecorators(array(
                   'ViewHelper',
                  'Description',                  
                  array('Label', array('tag' => null)),                   
           ));

        $password = new Zend_Form_Element_Password('password');
        $password->setLabel('Password: ')
                 ->setRequired(true)                 
                 ->addErrorMessage("Por favor informe o password")
                 ->setOptions(array('class' => 'input-m'));

        $password->setDecorators(array(
                   'ViewHelper',
                   'Description',        
                   array('Label', array('tag' => null)),
           ));

        $password->removeDecorator('Erros');
        $email->removeDecorator('Erros');
        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Logar');

        $submit->setDecorators(array(
                   'ViewHelper',
                   'Description',
                   'Errors',                   
                   array(array('row'=>'HtmlTag'),array('tag'=> 'p', 'class' => 'space'))
           ));
        $submit->setAttrib('class', 'login');

        $this->setDecorators(array(
               'FormElements',
               array(array('data'=>'HtmlTag'),array('tag'=>'p', 'class' => 'main')),
               'Form'
       ));

        $this->removeDecorator('Erros');

        $this->addElements(array($email, $password, $submit));

    }

}

?>
